<?php



namespace Admin\Controller;

class TestController extends AdminController{

    public function index(){
        $no = I('get.no');
        if(!intval($no)>0){
            $this->error('二维码生成失败！');
        }
        $file = 'Uploads/qrcode/'.$no.'号桌.png';
        $data = 'this is no.'.$no;
        createqrcode($data,$file);

        header('Content-type: image/png');
        header("Content-disposition:attachment;filename=".basename($file).";");
        header("Content-Length:".filesize($file));
        $qrc = readfile($file);
        echo $qrc;
    }
}
